package xyz.xwls.bootadmin.common;

/**
 * 通用的异常
 * @author WZW
 * @date 2020/4/1
 */
public class BootAdminException extends RuntimeException{

    /**
     * 异常错误码
     */
    private Long code;
    /**
     * 异常信息
     */
    private String message;

    public BootAdminException(ResultCode resultCode){
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    public BootAdminException() {
        this(ResultCode.FAILED);
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
